import { PrismaClient } from "@prisma/client";
import bc from "bcryptjs"

const p = new PrismaClient()

for(let i=1;i<=5;i++){
    await p.user.create({
        data: {
            name: `User ${i}`,
            email: `user${i}@email.com`,
            password: bc.hashSync(`password`,8)
        }
    })
}

for(let i=1; i<=100; i++){
    await p.product.create({
        data: {
            productNo: 'p'+String(i).padStart(6,'0'), //P000001
            name: `Product ${i}`,
            brand: `Brand ${i}`,
            spec: `Spec ${i}`
        }
    })
}